myApp.controller('menuManageController', function ($scope, $http) {
    $scope.menuSave = function () {
        if ($scope.pg.name == null || $scope.pg.name == undefined ||
            $scope.pg.path == null || $scope.pg.path == undefined) {
            alert('菜单名称或路径不能为空！！！');
            return false;
        } else {
            $http({
                url: "/addMenu",
                method: "post",
                dataType: 'json',
                contentType: 'application/json',
                data: $scope.pg
            })
                .success(function (data) {
                    if (data.message == 'success') {
                        alert('success');
                        window.location.reload(false);
                    }
                });
        }
    }
});


